package com.zsc.oj.mapper;

import com.zsc.oj.model.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @Entity com.zsc.oj.model.entity.Question
 */
public interface QuestionMapper extends BaseMapper<Question> {
    @Select("select questionId,count(*) as acceptNum from question_submit where judgeInfo like '%Accepted%' group by questionId")
    List<Integer> getAcceptedNum();

    @Select("select questionId,count(*) as submitNum from question_submit group by questionId;")
    List<Integer> getSubmitNumInt();

    @Select("select * from question where updateTime >= #{minUpdateTime}")
    List<Question> listQuestionWithDelete(Date minUpdateTime);
}




